package qf.sail.controller;

import qf.sail.entity.Account;
import qf.sail.service.AddressService;
import qf.sail.service.impl.AddressServiceImpl;
import qf.sail.vo.ResultVO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/getAddressList")
public class GetAddressListServlet extends BaseServlet{

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Account account = (Account) req.getSession().getAttribute("account");
        AddressService addressService = new AddressServiceImpl();
        ResultVO resultVO = new ResultVO();
        resultVO.addData("addressList",addressService.getAddressListByAccountId(account.getId()));
        repSuccess(resp,resultVO);
    }
}
